summaryrefslogtreecommitdiffstats
path: root/updater
diff options
context:
space:
mode:
authorandi34 <skate4life@gmx.de>2015-05-09 19:48:52 +0200
committerMichael Bestas <mkbestas@lineageos.org>2019-03-23 13:39:53 +0100
commit0ef6492518593eb1255e83723aaf9195fb582d6f (patch)
tree95cdff066049916dbc639bdeeec00405542e7dc2 /updater
parentDon't copy local mke2fs.conf for O-MR1 (diff)
downloadandroid_bootable_recovery-0ef6492518593eb1255e83723aaf9195fb582d6f.tar
android_bootable_recovery-0ef6492518593eb1255e83723aaf9195fb582d6f.tar.gz
android_bootable_recovery-0ef6492518593eb1255e83723aaf9195fb582d6f.tar.bz2
android_bootable_recovery-0ef6492518593eb1255e83723aaf9195fb582d6f.tar.lz
android_bootable_recovery-0ef6492518593eb1255e83723aaf9195fb582d6f.tar.xz
android_bootable_recovery-0ef6492518593eb1255e83723aaf9195fb582d6f.tar.zst
android_bootable_recovery-0ef6492518593eb1255e83723aaf9195fb582d6f.zip
Diffstat (limited to 'updater')
-rw-r--r--updater/Android.mk4
-rw-r--r--updater/blockimg.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index 3d2591391..b6955455a 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -74,6 +74,10 @@ LOCAL_CFLAGS := \
-Wall \
-Werror
+ifeq ($(BOARD_SUPPRESS_EMMC_WIPE),true)
+ LOCAL_CFLAGS += -DSUPPRESS_EMMC_WIPE
+endif
+
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH)/include
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index e93196b27..b44e1a219 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1499,10 +1499,12 @@ static int PerformCommandErase(CommandParameters& params) {
// length in bytes
blocks[1] = (range.second - range.first) * static_cast<uint64_t>(BLOCKSIZE);
+#ifndef SUPPRESS_EMMC_WIPE
if (ioctl(params.fd, BLKDISCARD, &blocks) == -1) {
PLOG(ERROR) << "BLKDISCARD ioctl failed";
return -1;
}
+#endif
}
}